﻿@model IEnumerable<ConcurrencyTest.Models.EntityY>

@{
    ViewBag.Title = "Y elements list (Pessimistic concurrency)";
}

<h2>@ViewBag.Title</h2>


@if (!string.IsNullOrEmpty(@ViewBag.Message)) {
<div class="alert alert-success fade in">
    <a href="#" class="close" data-dismiss="alert">&times;</a>
    @ViewBag.Message
</div>
}

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Id)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Price)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.LockedBy)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model) {
    <tr>
        @Html.HiddenFor(model => item.Id)
        <td>
            @Html.DisplayFor(modelItem => item.Id)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LockedBy)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
    </tr>
    }

</table>
